home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume23 / trn / part01 next >
Encoding:
Text File  |  1991-08-22  |  63.3 KB  |  2,414 lines

  1. This is a new archive version of TRN at patchlevel 3.
  2. The original posting took up Volume23, issues 60 to 73, with
  3. various problems.  These files replace those issues.
  4.  
  5. #! /bin/sh
  6. # This is a shell archive.  Remove anything before this line, then feed it
  7. # into a shell via "sh file" or similar.  To overwrite existing files,
  8. # type "sh file -c".
  9. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  10. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  11. # Contents:  README Configure.2 head.h patchlevel zab
  12. # Wrapped by rsalz@litchi.bbn.com on Fri Aug 23 16:38:48 1991
  13. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  14. echo If this archive is complete, you will see the following message:
  15. echo '          "shar: End of archive 1 (of 14)."'
  16. if test -f 'README' -a "${1}" != "-c" ; then 
  17.   echo shar: Will not clobber existing file \"'README'\"
  18. else
  19.   echo shar: Extracting \"'README'\" \(9074 characters\)
  20.   sed "s/^X//" >'README' <<'END_OF_FILE'
  21. X            Trn Kit, Version 1.0
  22. X
  23. X            Copyright (c) 1985, Larry Wall
  24. X           Copyright (c) 1990, Wayne Davison
  25. X
  26. XYou may copy the trn kit in whole or in part as long as you don't try to
  27. Xmake money off it, or pretend that you wrote it.
  28. X--------------------------------------------------------------------------
  29. X
  30. XPlease read all the directions in this file (following the brief description
  31. Xof trn) before you proceed with the installation.  Failure to do so may void
  32. Xyour warranty. :-)
  33. X
  34. XAfter you have unpacked your kit, you should have all the files listed
  35. Xin MANIFEST.
  36. X
  37. X
  38. XWhat is trn?
  39. X------------
  40. XTrn is "Threaded RN" -- a newsreader that uses an article's "References:"
  41. Xto order the discussions in a very natural, reply-ordered sequence called
  42. X"threads."  Having the replies associated with their parent articles not
  43. Xonly makes following the discussion easier, but also makes it easy to back-
  44. Xtrack and (re-)read a specific discussion from the beginning.  Trn also
  45. Xhas a visual representation of the current thread in the upper right corner
  46. Xof the header, which will give you a feel for how the discussion is going
  47. Xand how the current article is related to the last one you read.
  48. X
  49. XIn addition, a thread browser/selector has been added to make life in the big
  50. Xnewsgroups much easier to live with.  It also allows you to quickly browse
  51. Xthrough already-read articles and select the one(s) you wish to read again.
  52. XOther new features include an extract command for the source and binary groups,
  53. Xthread-oriented kill directives, and additional "magic" in the header display.
  54. X
  55. XTo use all the new features of trn will require the maintenance of a thread
  56. Xdatabase, which is handled by the included database manager.  The amount of
  57. Xspace required is around 5% of your newsspool size (either in /usr/spool/news
  58. Xor on another partition), but you can choose to only keep thread information
  59. Xfor a select portion of the newsgroups if you wish -- unthreaded groups are
  60. Xread in an rn-compatible manner.
  61. X
  62. XTrn can be optionally compiled as trrn -- a NNTP-compatible newsreader that
  63. Xlets you access news from a remote news server.  Each client machine must
  64. Xmaintain their own database, either via the NNTP version of the database
  65. Xmanager, or by sharing the server's thread files through some other means.
  66. X
  67. XTrn is based on the source to Larry Wall's rn (patchlevel 47), and the threaded
  68. Xextensions are fully conditionalized.  Thus, it is possible to use this source
  69. Xto compile both trn and (a slightly enhanced version of) rn.  In fact, it is
  70. Xpossible to install trn as both rn and trn (linked together) to maintain only
  71. Xone newsreader on a system where people wish to continue to use rn.
  72. X
  73. XAlso, I'd like to publicly thank all the people who have helped me in testing
  74. Xtrn -- without their input, trn would have been much less compatible with all
  75. Xthe Unix and Xenix systems out there, and not as easy to use:
  76. X
  77. XBrandon S. Allbery, Chip Rosenthal, Chip Salzenberg, David C Lawrence,
  78. XEric Schnoebelen, George H. Martin, Guy Harris, Jason Molenda, Jaye Mathisen,
  79. XJeff Sparkes, Jon Zeeff, Kurt Gollhardt, Linus Tolke, Mitchell F. Wyle.
  80. X
  81. XThanx guys!
  82. X
  83. X
  84. XInstallation
  85. X------------
  86. X0)  Decide if you want to compile the newsreader as trrn (threaded remote
  87. X    rn) to read its articles using NNTP from a news server, or as regular
  88. X    trn to read the articles from the news spool directory (which could be
  89. X    mounted locally or via NFS).  The thread database created by mthreads
  90. X    must be accessable on each machine, which means that NNTP machines will
  91. X    need to maintain a local copy (usually by running the NNTP version of
  92. X    mthreads), or share a common copy.  By choosing to create trrn (at the
  93. X    appropriate prompt in Configure), you will enable the NNTP code in both
  94. X    trn and mthreads.  Be sure you have installed your NNTP client (including
  95. X    the NNTP inews and the file that contains the name of the NNTP server)
  96. X    before running Configure.  Trrn expects at least NNTP version 1.5.
  97. X
  98. X    Decide if you want to install trn as both rn and trn linked together.
  99. X    It is possible to configure trn to check the first letter of its name
  100. X    and only turn on the threaded extensions if it is a 't'.  Thus, you
  101. X    only have to maintain one newsreader package that is both a "normal"
  102. X    rn and has all the extensions of trn available for the asking.
  103. X
  104. X    Also decide where you want to put the thread files.  The recommended
  105. X    spot for people with over 5% of your /usr/spool/news size free is to
  106. X    place a ".thread" file in each spool directory.  The other alternative
  107. X    is to create a directory for them (possibly on another drive) and enter
  108. X    this path at the appropriate Configure question.  Remember that you are
  109. X    not required to create thread files for all groups.  Some sites choose
  110. X    to only thread high-volume discussion groups (see the mthreads manpage),
  111. X    which will lower the amount of space required for thread files.
  112. X
  113. X    ** If you got trn in shar format, check Configure to ensure that WHITE
  114. X    and CTRLA have a Tab-Space and a Ctrl-A in them, respectively. **
  115. X
  116. X1)  Run Configure.  This will figure out various things about your system.
  117. X    Some things Configure will figure out for itself, other things it will
  118. X    ask you about.  It will then proceed to make config.h, config.sh, Makefile,
  119. X    and a bunch of shell scripts.  It will also do a make depend for you, or
  120. X    let you start one in the background.  You might possibly have to trim #
  121. X    comments from the front of Configure if your sh doesn't handle them, but
  122. X    all other # comments will be taken care of.
  123. X
  124. X2)  Glance through config.h and common.h to make sure system dependencies
  125. X    are correct.  Most of them should have been taken care of by running
  126. X    the Configure script.
  127. X
  128. X    If you have any additional changes to make to the C definitions, they
  129. X    can be done in the Makefile, in config.h, or in common.h.  If you have
  130. X    strange mailboxes on your system you should modify mbox.saver to correctly
  131. X    append an article to a mailbox or folder.
  132. X
  133. X    If you are on a machine with limited address space, you may have to
  134. X    remove some of the special functions of trn to make it fit.  This is
  135. X    easily done by undefining symbols in the System Dependencies section
  136. X    of common.h.  You should run "make depend" again to be safe.
  137. X
  138. X3)  make
  139. X
  140. X    This will attempt to make trn in the current directory.
  141. X
  142. X4)  make install
  143. X
  144. X    This will put trn, newsetup, newsgroups, Pnews, and Rnmail into a public
  145. X    directory (normally /usr/local/bin), and put a number of files -- including
  146. X    mthreads (the database manager executable) -- into the private trn library
  147. X    (e.g. /usr/local/lib/trn).  It will also try to put the man pages in a
  148. X    reasonable place.
  149. X
  150. X5)  Once trn is compiled, you need to create some thread data to be
  151. X    able to use all the new features.  If you like, you can start small
  152. X    with a command like:  "mthreads rec.humor.funny", process a few more
  153. X    groups with the command "mthreads news", and then turn them all on
  154. X    with the command "mthreads all".  Read the mthreads manpage for
  155. X    complete details.
  156. X
  157. X6)  Read the trn manual entry before running trn, or at least read the file
  158. X    NEW if you are already familiar with rn.
  159. X
  160. X7)  Try trn, and play with some of the switches.  You may want to make -X
  161. X    the default on your system (you might have done this already in Configure).
  162. X    This is done by changing SELECT_INIT in config.h.  You may also want to
  163. X    modify which header lines are displayed by default and which are magic --
  164. X    This is done in head.h.
  165. X
  166. X    To change default values of enviroment variables on a system-wide basis
  167. X    without recompiling trn, put the switches into the file INIT in the trn
  168. X    library.
  169. X
  170. X8)  Arrange to have the mthreads command of your choosing run on a regular
  171. X    basis.  If you run with the daemon flag, you can start it from the boot
  172. X    sequence (make sure it is su'ed appropriately), or even run it daily
  173. X    out of cron (if it's already running, the new version will exit).  If
  174. X    you run mthreads in single-pass mode, you'll want to have cron execute
  175. X    it on a regular basis with the standard-output redirected to /dev/null.
  176. X
  177. X9)  IMPORTANT!  Help save the world!  Communicate any problems and suggested
  178. X    patches to Wayne Davison (davison@borland.com) so we can keep
  179. X    everyone in sync.  If you have a problem, there's someone else
  180. X    out there who either has had or will have the same problem.  Please
  181. X    don't bother either Larry Wall or Stan Barber with bugs that you
  182. X    find in trn.  If the bug is applicable to mainstream rn code, I
  183. X    will pass it along.
  184. X
  185. X    If possible, send in patches such that the patch program will apply them.
  186. X    Context diffs are the best, then normal diffs.  Don't send ed scripts--
  187. X    I've probably changed my copy since the version you have.
  188. X
  189. X    Watch for trn patches in news.software.b or comp.sources.bugs.  Patches
  190. X    will always be in context diff format, to be applied by the patch program.
  191. X
  192. X10) If you are going to hack on trn, please refer to rn's HACKERSGUIDE first.
  193. END_OF_FILE
  194.   if test 9074 -ne `wc -c <'README'`; then
  195.     echo shar: \"'README'\" unpacked with wrong size!
  196.   fi
  197.   # end of 'README'
  198. fi
  199. if test -f 'Configure.2' -a "${1}" != "-c" ; then 
  200.   echo shar: Will not clobber existing file \"'Configure.2'\"
  201. else
  202.   echo shar: Extracting \"'Configure.2'\" \(43215 characters\)
  203.   sed "s/^X//" >'Configure.2' <<'END_OF_FILE'
  204. X*)  dflt="$domain" ;;
  205. Xesac
  206. X$echo $n "Your domain: [$dflt] $c"
  207. X. myread
  208. Xcase "$ans" in
  209. X'') domain="$dflt";;
  210. X*)  domain="$ans" ;;
  211. Xesac
  212. X
  213. X: now get the site name
  214. X$echo " "
  215. X$echo "Figuring out site name..."
  216. X$echo 'Maybe "hostname" will work...'
  217. Xif ans=`sh -c hostname 2>&1` ; then
  218. X    thissite=$ans
  219. X    hostcmd=hostname
  220. Xelse
  221. X    $echo 'No, maybe "uuname -l" will work...'
  222. X    if ans=`sh -c 'uuname -l' 2>&1` ; then
  223. X    thissite=$ans
  224. X    hostcmd='uuname -l'
  225. X    else
  226. X    $echo 'Strange.  Maybe "uname -n" will work...'
  227. X    if ans=`sh -c 'uname -n' 2>&1` ; then
  228. X        thissite=$ans
  229. X        hostcmd='uname -n'
  230. X    else
  231. X        $echo 'Oh well, maybe I can mine it out of whoami.h...'
  232. X        if ans=`sh -c $contains' sysname /usr/include/whoami.h' 2>&1` ; then
  233. X        thissite=`$echo "$ans" | $sed 's/^.*"\(.*\)"/\1/'`
  234. X        hostcmd="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' </usr/include/whoami.h"
  235. X        else
  236. X        case "$sitename" in
  237. X        '') $echo "Does this machine have an identity crisis or something?"
  238. X            hostcmd=''
  239. X            ;;
  240. X        *)  $echo "Well, you said $sitename before..."
  241. X            thissite="$sitename"
  242. X            ;;
  243. X        esac
  244. X        fi
  245. X    fi
  246. X    fi
  247. Xfi
  248. X: you do not want to know about this
  249. Xset $thissite
  250. Xthissite=$1
  251. X
  252. X: translate upper to lower case. This is mostly to help UUCP work right.
  253. Xcase $thissite in
  254. X    *[A-Z]*)
  255. X    thissite=`$echo $thissite | tr '[A-Z]' '[a-z]'`
  256. X    $echo "(Normalizing case in your site name)"
  257. X    ;;
  258. Xesac
  259. X
  260. X: verify site name and allow them to override it
  261. Xif $test "$thissite" ; then
  262. X    $echo 'Your site name appears to be "'$thissite'".'
  263. Xelse
  264. X    thissite='unknown'
  265. Xfi
  266. Xcase "$hostfile" in
  267. X/*) dflt="$hostfile" ;;
  268. X*)  case "$sitename" in
  269. X    '') dflt="$thissite" ;;
  270. X    *)  dflt="$sitename" ;;
  271. X    esac
  272. Xesac
  273. X$cat <<'EOM'
  274. X
  275. XIn some cases it is not desirable to use the actual site name in your return
  276. Xaddresses (if, for example, all mail gets routed first to one site).  In this
  277. Xcase trn allows you to either hard-wire a site name or read the site name from
  278. Xa file.  To indicate a file, start the name with a slash (e.g. /etc/sitename).
  279. XTo use just your domain name, re-enter it here.  A period-less site name will
  280. Xautomatically get your domain name added to it.
  281. X
  282. XEOM
  283. Xwhile $test $dflt ; do
  284. X    $echo $n "What site name goes in return addresses? [$dflt] $c"
  285. X    . myread 
  286. X    case $ans in
  287. X    '') ans=$dflt;;
  288. X    esac
  289. X    case $ans in
  290. X    /*)
  291. X    if $test -f $ans ; then
  292. X        hostfile="$ans"
  293. X        hostcmd="$cat $ans"
  294. X        sitename=`$hostcmd`
  295. X        $echo "Trn will read the site name from $ans:  $sitename."
  296. X        dflt=''
  297. X    else
  298. X        $echo "Unable to locate $ans."
  299. X    fi
  300. X    ;;
  301. X    *)  hostfile=''
  302. X    if $test "X$thissite" = "X$ans" ; then
  303. X        sitename="$thissite"
  304. X        $echo "Using the site name derived by $hostcmd:  $sitename."
  305. X    else
  306. X        hostcmd=''
  307. X        sitename="$ans"
  308. X        $echo "Using a hard-wired site name:  $sitename."
  309. X    fi
  310. X    dflt=''
  311. X    ;;
  312. X    esac
  313. Xdone
  314. X
  315. Xif $test $portable = "undef" ; then
  316. X    case $sitename in
  317. X    *.*)    ;;
  318. X    *)    sitename=$sitename.$domain
  319. X        ;;
  320. X    esac
  321. Xfi
  322. X
  323. Xcase $hiddennet in
  324. Xdefine)    dflt=y;;
  325. X*)    dflt=n;;
  326. Xesac
  327. X$echo "Do you want your site ($sitename) to be hidden in"
  328. X$echo $n "domain '$domain'? [$dflt] $c"
  329. X. myread
  330. Xcase $ans in
  331. X  '') ans=$dflt ;;
  332. Xesac
  333. Xcase $ans in
  334. Xy*)    hiddennet=define
  335. X    sitename=$domain
  336. X    ;;
  337. X*)    hiddennet=undef
  338. X    ;;
  339. Xesac
  340. X
  341. X: get organization name
  342. Xlongshots='/usr/src/new /usr/src/local /usr/local/src'
  343. Xcase "$orgname" in
  344. X'') if xxx=`loc news/src/defs.h x $longshots`; then
  345. X    dflt=`$sed -n 's/^.*MYORG[     ]*"\(.*\)".*$/\1/p' $xxx`
  346. X    else
  347. X    dflt='no default'
  348. X    fi
  349. X    ;;
  350. X*)  dflt="$orgname";;
  351. Xesac
  352. X$cat << 'EOH'
  353. XPlease type the name of your organization as you want it to appear on the
  354. XOrganization line of outgoing articles.  (It's nice if this also specifies
  355. Xyour location.  Your city name is probably sufficient if well known.)
  356. XFor example:
  357. X
  358. X    University of Southern North Dakota, Hoople
  359. X
  360. XYou may also put the name of a file, as long as it begins with a slash.
  361. XFor example:
  362. X
  363. X    /etc/organization
  364. X
  365. XEOH
  366. Xorgname="no default"
  367. Xwhile test "X$orgname" = "Xno default"; do
  368. X    $echo $n "Organization: [$dflt] $c"
  369. X    . myread
  370. X    case "$ans" in
  371. X    '') orgname="$dflt";;
  372. X    *)  orgname="$ans" ;;
  373. X    esac
  374. Xdone
  375. X
  376. X: get news administrator name
  377. Xcase "$newsadmin" in
  378. X'')
  379. X    if $contains "^news:" /etc/passwd >/dev/null 2>&1 ; then
  380. X    dflt=news
  381. X    else
  382. X    if $contains "^usenet:" /etc/passwd >/dev/null 2>&1 ; then
  383. X        dflt=usenet
  384. X    else
  385. X        if eunice; then
  386. X        dflt=system
  387. X        else
  388. X        dflt=root
  389. X        fi
  390. X    fi
  391. X    fi
  392. X    ;;
  393. X*)  dflt="$newsadmin"
  394. X    ;;
  395. Xesac
  396. Xcat <<'EOM'
  397. XMany systems keep their news in a private directory, or have a non-superuser
  398. Xin charge of administering news.  (If you don't have such a user, take the
  399. Xdefault answer.)  What is the login name (not directory) that is used for news
  400. XEOM
  401. X$echo $n "administration? [$dflt] $c"
  402. X. myread
  403. Xnewsadmin="$ans"
  404. Xcase $newsadmin in
  405. X'') newsadmin=$dflt ;;
  406. Xesac
  407. Xcase $newsadmin in
  408. Xroot) isadmin=undef ;;
  409. X*)    isadmin=define ;;
  410. Xesac
  411. X
  412. X: figure out news library
  413. Xcase "$lib" in
  414. X'')
  415. X    dflt=/usr/lib/news
  416. X    ;;
  417. X*)  dflt=$lib ;;
  418. Xesac
  419. Xlibexp=$lib
  420. Xlibexp='blurfl/dyick'
  421. Xwhile $test ! -d "$libexp"; do
  422. X    $echo " "
  423. X    case "$libexp" in
  424. X    blurfl*) ;;
  425. X    *) $echo "Directory $libexp not found";;
  426. X    esac
  427. X    $echo $n "Where is your news library (~name okay)? [$dflt] $c"
  428. X    . myread
  429. X    case "$ans" in
  430. X    '') ans="$dflt";;
  431. X    esac
  432. X    lib="$ans"
  433. X    case $lib in
  434. X    ~*)
  435. X    libexp=`filexp $lib`
  436. X    $echo "(That is $libexp on this particular system.)"
  437. X    case $portable in
  438. X      undef) lib=$libexp ;;
  439. X    esac
  440. X    ;;
  441. X    *)
  442. X    libexp=$lib
  443. X    ;;
  444. X    esac
  445. Xdone
  446. Xif $test -f $libexp/inews; then
  447. X    $echo "Aha!  Inews is really in $libexp!"
  448. X    $echo "Maybe this is Bnews 2.10.2 or later."
  449. X    inews=$libexp/inews
  450. Xfi
  451. X
  452. X: determine where manual pages go
  453. Xcase "$mansrc" in
  454. X'')
  455. X    dflt=`loc . /usr/man/man1 /usr/man/mann /usr/man/local/man1 /usr/man/u_man/man1 /usr/man/man1`
  456. X    ;;
  457. X*)  dflt="$mansrc"
  458. X    ;;
  459. Xesac
  460. Xmansrc='blurfl/dyick'
  461. Xwhile $test ! -d "$mansrc" ; do
  462. X    case $mansrc in
  463. X      blurfl*) ;;
  464. X      *) $echo "$mansrc does not appear to exist." ;;
  465. X    esac
  466. X    $echo " "
  467. X    $echo $n "Where do the manual pages (source) go? [$dflt] $c"
  468. X    . myread
  469. X    mansrc=`filexp "$ans"`
  470. X    case $mansrc in
  471. X      '') mansrc=$dflt ;;
  472. X    esac
  473. Xdone
  474. Xcase "$mansrc" in
  475. X*l)
  476. X    manext=l
  477. X    ;;
  478. X*n)
  479. X    manext=n
  480. X    ;;
  481. X*)
  482. X    manext=1
  483. X    ;;
  484. Xesac
  485. X
  486. X: determine where mail is spooled
  487. Xcase "$maildir" in
  488. X'')
  489. X    dflt=`loc . /usr/spool/mail /usr/spool/mail /usr/mail`
  490. X    ;;
  491. X*)  dflt="$maildir"
  492. X    ;;
  493. Xesac
  494. Xcase "$dflt" in
  495. X*%L*) ;;
  496. X*)    dflt="$dflt/%L"
  497. Xesac
  498. X$cat <<'EOM'
  499. X
  500. XTrn needs to know where to find yet-to-be-read mail.  Sendmail sites
  501. Xuse /usr/spool/mail/%L (where '%L' is the user's login name).  Some
  502. XMMDF sites use /usa/%L/.mail instead.
  503. X
  504. XEOM
  505. X$echo $n "Where is yet-to-be-read mail spooled? [$dflt] $c"
  506. X. myread
  507. Xmaildir="$ans"
  508. Xcase $maildir in
  509. X'') maildir=$dflt ;;
  510. Xesac
  511. X
  512. X: find out how to find out full name
  513. X$echo " "
  514. Xcase "$berknam" in
  515. Xdefine)
  516. X    dflt=y;;
  517. Xundef)
  518. X    dflt=n;;
  519. X*)
  520. X    if bsd || xenix; then
  521. X    dflt=y
  522. X    else
  523. X    dflt=n
  524. X    fi
  525. X    ;;
  526. Xesac
  527. X$echo "Does your /etc/passwd file keep full names in Berkeley/V7 format (name first"
  528. X$echo $n "thing after ':' in GCOS field)? [$dflt] $c"
  529. X. myread
  530. Xcase $ans in
  531. X  '') ans=$dflt ;;
  532. Xesac
  533. Xcase $ans in
  534. X  y*)
  535. X    passnam=define
  536. X    berknam=define
  537. X    usgnam=undef
  538. X    nametype=bsd
  539. X    ;;
  540. X  *)
  541. X    $echo " "
  542. X    case "$usgnam" in
  543. X    define)
  544. X    dflt=y;;
  545. X    undef)
  546. X    dflt=n;;
  547. X    *)
  548. X    if usg; then
  549. X        dflt=y
  550. X    else
  551. X        dflt=n
  552. X    fi
  553. X    ;;
  554. X    esac
  555. X    $echo "Does your passwd file keep full names in USG format (name sandwiched"
  556. X    $echo $n "between a '-' and a '(')? [$dflt] $c"
  557. X    . myread
  558. X    case $ans in
  559. X      '') ans=$dflt ;;
  560. X    esac
  561. X    case $ans in
  562. X      n*)
  563. X    $echo "Full name will be taken from ~/.fullname"
  564. X    passnam=undef
  565. X    berknam=undef
  566. X    usgnam=undef
  567. X    nametype=other
  568. X    ;;
  569. X      *)
  570. X    passnam=define
  571. X    berknam=undef
  572. X    usgnam=define
  573. X    nametype=usg
  574. X    ;;
  575. X    esac
  576. X    ;;
  577. Xesac
  578. X
  579. X: see if we need a special compiler
  580. X$echo " "
  581. Xif usg; then
  582. X    case "$cc" in
  583. X    '')
  584. X    case "$Mcc" in
  585. X    /*) dflt='Mcc'
  586. X        ;;
  587. X    *)
  588. X        if $contains '\-M' $mansrc/cc.1 >/dev/null 2>&1 ; then
  589. X        dflt='cc -M'
  590. X        else
  591. X        dflt='cc'
  592. X        fi
  593. X        ;;
  594. X    esac
  595. X    ;;
  596. X    *)  dflt="$cc";;
  597. X    esac
  598. X    $cat <<'EOM'
  599. XOn some systems the default C compiler will not resolve multiple global
  600. Xreferences that happen to have the same name.  On some such systems the
  601. X"Mcc" command may be used to force these to be resolved.  On other systems
  602. Xa "cc -M" command is required.  What command will force resolution on
  603. XEOM
  604. X    $echo $n "this system? [$dflt] $c"
  605. X    . myread
  606. X    cc="$ans"
  607. X    case "$cc" in
  608. X    '') cc="$dflt" ;;
  609. X    esac
  610. Xelse
  611. X    $echo "Not a USG system--assuming cc can resolve multiple definitions."
  612. X    cc=cc
  613. Xfi
  614. X
  615. X: see if we should throw a -i into the Makefile
  616. X$echo " "
  617. Xif pdp11; then
  618. X    if $contains '\-i' $mansrc/cc.1 >/dev/null 2>&1 ; then
  619. X    $echo $n "Your system appears to have separate I and D space.  Is this true? [y] $c"
  620. X    . myread
  621. X    case $ans in
  622. X        n*|f*) iandd='' ;;
  623. X        *)     iandd='-i' ;;
  624. X    esac
  625. X    else
  626. X    $echo "Your system appears to NOT have separate I and D space."
  627. X    $echo $n "Is this correct? [y] $c"
  628. X    . myread
  629. X    case $ans in
  630. X        n*|f*) iandd='-i' ;;
  631. X        *)     iandd='' ;;
  632. X    esac
  633. X    fi
  634. Xelse
  635. X    $echo "Not a pdp11--assuming no separate I and D."
  636. Xfi
  637. X
  638. X: index or strcpy
  639. X$echo " "
  640. Xif $contains index.o libc.list >/dev/null 2>&1 ; then
  641. X    $echo "Your system appears to use index() and rindex() rather than strchr()"
  642. X    $echo $n "and strrchr().  Is this correct? [y] $c"
  643. X    . myread
  644. X    case $ans in
  645. X    n*|f*) strchr='define' ;;
  646. X    *)     strchr='undef' ;;
  647. X    esac
  648. Xelse
  649. X    $echo "Your system appears to use strchr() and strrchr() rather than index()"
  650. X    $echo $n "and rindex().  Is this correct? [y] $c"
  651. X    . myread
  652. X    case $ans in
  653. X    n*|f*) strchr=undef ;;
  654. X    *)     strchr=define ;;
  655. X    esac
  656. Xfi
  657. X
  658. X: bcopy/bzero or memcpy/memset
  659. X$echo " "
  660. Xif $contains bcopy.o libc.list >/dev/null 2>&1 ; then
  661. X    $echo "Your system appears to use bcopy() and bzero() rather than memcpy()"
  662. X    $echo $n "and memset().  Is this correct? [y] $c"
  663. X    . myread
  664. X    case $ans in
  665. X    n*|f*) memcpy='define' ;;
  666. X    *)     memcpy='undef' ;;
  667. X    esac
  668. Xelse
  669. X    $echo "Your system appears to use memcpy() and memset() rather than bcopy()"
  670. X    $echo $n "and bzero().  Is this correct? [y] $c"
  671. X    . myread
  672. X    case $ans in
  673. X    n*|f*) memcpy='undef' ;;
  674. X    *)     memcpy='define' ;;
  675. X    esac
  676. Xfi
  677. X
  678. X: check for S5-style timezone handling - current offset from GMT in
  679. X: external variable "timezone" rather than gotten with "ftime".
  680. X$echo " "
  681. Xif $contains tzname /usr/include/time.h >/dev/null 2>&1 ; then
  682. X    $echo "Your system appears to get the current timezone's offset"
  683. X    $echo "from GMT from the external variable timezone rather than"
  684. X    $echo "by calling ftime() or gettimeofday()."
  685. X    $echo $n "Is this correct? [y] $c"
  686. X    . myread
  687. X    case $ans in
  688. X    n*|f*) tzset='undef' ;;
  689. X    *)     tzset='define' ;;
  690. X    esac
  691. Xelse
  692. X    $echo "Your system appears to get the current timezone's offset"
  693. X    $echo "from GMT by calling ftime() or gettimeofday() rather than"
  694. X    $echo "from the external variable timezone."
  695. X    $echo $n "Is this correct? [y] $c"
  696. X    . myread
  697. X    case $ans in
  698. X    n*|f*) tzset='define' ;;
  699. X    *)     tzset='undef' ;;
  700. X    esac
  701. Xfi
  702. X
  703. X: determine how to determine when a file is a mailbox
  704. Xcase "$mboxchar" in
  705. X'') dflt=F;;
  706. X*)  dflt="$mboxchar";;
  707. Xesac
  708. X$cat <<'EOM'
  709. XIn saving articles, trn wants to differentiate between saving to mailbox
  710. Xformat files and normal files.  It does this by examining the first character
  711. Xof the file in question.  On most systems the first line starts "From...",
  712. Xso the first character is F.  On other systems there are magic cookies like
  713. Xcontrol codes between articles, so one of those would be first.  For example,
  714. XMMDF messages are separated with lines of 4 control-A's.  On your system, if a
  715. XEOM
  716. X$echo $n "file is in mailbox format, what is the first character of that file? [$dflt] $c"
  717. X. myread
  718. Xmboxchar="$ans"
  719. Xcase $mboxchar in
  720. X'') mboxchar="$dflt" ;;
  721. Xesac
  722. Xcase $mboxchar in
  723. X'F') ;;
  724. X"$CTRLA") ;;
  725. X*)  cat <<'EOM'
  726. XYou will need to edit the shell script mbox.saver to properly append an
  727. Xarticle to a mailbox.  The arguments to the script are documented in
  728. XEOM
  729. X    case $shsharp in
  730. X    false)
  731. X    $echo "comments in mbox.saver.std."
  732. X    ;;
  733. X    true)
  734. X    $echo "comments in the shell script itself."
  735. X    ;;
  736. X    esac
  737. Xesac
  738. X$rm -f grimble
  739. X: where do we get termlib routines from
  740. X$echo " "
  741. Xans=`loc libcurses.a x /usr/lib /usr/local/lib /lib`
  742. Xcase "$ans" in
  743. X/*)
  744. X    ar t $ans >grimble
  745. X    if $contains tputs.o grimble >/dev/null 2>&1; then
  746. X    termlib='-lcurses'
  747. X    havetlib=define
  748. X    $echo "Terminfo library found."
  749. X    else
  750. X    ans=x
  751. X    fi
  752. X    ;;
  753. Xesac
  754. Xcase "$ans" in
  755. Xx)
  756. X    ans=`loc libtermlib.a x /usr/lib /usr/local/lib /lib`
  757. X    case "$ans" in
  758. X    /usr/lib*|/lib*)
  759. X    termlib='-ltermlib'
  760. X    havetlib=define
  761. X    $echo "Termlib library found."
  762. X    ;;
  763. X    /*)
  764. X    termlib="$ans"
  765. X    havetlib=define
  766. X    $echo "Termlib library found."
  767. X    ;;
  768. X    *)
  769. X    if xenix; then
  770. X        ans=/lib/Llibtermcap.a
  771. X    else
  772. X        ans=`loc libtermcap.a x /usr/lib /usr/local/lib /lib`
  773. X    fi
  774. X    case "$ans" in
  775. X    /usr/lib*|/lib*)
  776. X        termlib='-ltermcap'
  777. X        havetlib=define
  778. X        $echo "Termcap library found."
  779. X        ;;
  780. X    /*)
  781. X        termlib="$ans"
  782. X        havetlib=define
  783. X        $echo "Termcap library found."
  784. X        ;;
  785. X    *)
  786. X        case "$termlib" in
  787. X        '')
  788. X        $echo $n "Your system appears to NOT have termlib-style routines.  Is this true? [y] $c"
  789. X        . myread
  790. X        case $ans in
  791. X            n*|f*) havetlib=define
  792. X              $echo "Then where are the termlib-style routines kept (specify either -llibname"
  793. X              $echo $n " or full pathname (~name ok))? $c"
  794. X              . myread
  795. X              termlib=`filexp $ans`
  796. X              ;;
  797. X            *)    havetlib=undef
  798. X              termlib=''
  799. X              $echo "You will have to play around with term.c then."
  800. X              ;;
  801. X        esac
  802. X        $echo " "
  803. X        ;;
  804. X        *)  $echo "You said termlib was $termlib before."
  805. X        ;;
  806. X        esac
  807. X        ;;
  808. X    esac
  809. X    ;;
  810. X    esac
  811. X    ;;
  812. Xesac
  813. X: see if there is a whoami file
  814. Xif $test -r /usr/include/whoami.h ; then
  815. X    whoami=define
  816. X    $echo "whoami.h found."
  817. Xelse
  818. X    whoami=undef
  819. Xfi
  820. X
  821. X: see if this is a termio system
  822. Xultrix ; ultrix=$?
  823. Xsun ; sun=$?
  824. Xpyr ; pyr=$?
  825. Xif $test -r /usr/include/termio.h -a $ultrix -ne 0 -a $sun -ne 0 -a $pyr -ne 0; then
  826. X      termio=define
  827. X      $echo "termio.h found."
  828. X  else
  829. X    if $test -r /usr/include/sgtty.h ; then
  830. X    termio=undef
  831. X    $echo "sgtty.h found."
  832. X    else
  833. X    termio=undef
  834. X    $echo "Neither termio.h nor sgtty.h found--you could have problems."
  835. X    fi
  836. Xfi
  837. X
  838. X: see if this system has fcntl
  839. Xif $test -r /usr/include/fcntl.h ; then
  840. X    fcntl=define
  841. X    $echo "fcntl.h found."
  842. Xelse
  843. X    fcntl=undef
  844. X    $echo "No fcntl.h found, but that's ok."
  845. Xfi
  846. X
  847. X: see if ioctl defs are in sgtty/termio or sys/ioctl
  848. Xif $test -r /usr/include/sys/ioctl.h ; then
  849. X    ioctl=define
  850. X    $echo "sys/ioctl.h found."
  851. Xelse
  852. X    ioctl=undef
  853. X    $echo "sys/ioctl.h not found, assuming ioctl args are defined in sgtty.h."
  854. Xfi
  855. X
  856. X: see if ptem.h exists
  857. Xif $test -r /usr/include/sys/ptem.h ; then
  858. X    ptem=define
  859. X    $echo "sys/ptem.h found."
  860. Xelse
  861. X    ptem=undef
  862. Xfi
  863. X
  864. X: see if the system has sigblock
  865. Xif $contains sigblock.o libc.list >/dev/null 2>&1 ; then
  866. X    $echo "sigblock() found."
  867. X    sigblock=define
  868. Xelse
  869. X    sigblock=undef
  870. Xfi
  871. X
  872. X: see if the system has getwd
  873. Xif $contains getwd.o libc.list >/dev/null 2>&1 ; then
  874. X    $echo "getwd() found."
  875. X    getcwd=undef
  876. X    getwd=define
  877. Xelse
  878. X: see if the system has getcwd
  879. Xif $contains getcwd.o libc.list >/dev/null 2>&1 ; then
  880. X    $echo "getcwd() found."
  881. X    getcwd=define
  882. X    getwd=undef
  883. Xelse
  884. X    getcwd=undef
  885. X    getwd=undef
  886. Xfi
  887. Xfi
  888. X
  889. X: see if there is a vfork
  890. Xif $contains vfork.o libc.list >/dev/null 2>&1 ; then
  891. X    $echo "vfork() found."
  892. X    novfork='undef'
  893. Xelse
  894. X    if next; then
  895. X    $echo "I know NeXTs have vfork()!"
  896. X    novfork='undef'
  897. X    else
  898. X    $echo "No vfork() found--will use fork() instead."
  899. X    novfork='define'
  900. X    fi
  901. Xfi
  902. X
  903. X: check for rename
  904. Xif $contains rename.o libc.list >/dev/null 2>&1 ; then
  905. X    $echo "rename() found."
  906. X    rename='define'
  907. Xelse
  908. X    $echo "No rename() found -- we'll emulate it."
  909. X    rename='undef'
  910. Xfi
  911. X
  912. X: check for truncate
  913. Xif $contains truncate.o libc.list >/dev/null 2>&1 ; then
  914. X    $echo "truncate() found."
  915. X    truncate='define'
  916. Xelse
  917. X    $echo "No truncate() found -- we'll emulate it."
  918. X    truncate='undef'
  919. Xfi
  920. X
  921. X: see if YP could be running here
  922. Xif $contains yp_master.o libc.list >/dev/null 2>&1 ; then
  923. X    $echo "YP may be running -- will use getpwent(), just in case."
  924. X    getpwent='define'
  925. Xelse
  926. X: see if there is a getpw
  927. Xif $contains getpw.o libc.list >/dev/null 2>&1 ; then
  928. X    $echo "getpw() found."
  929. X    getpwent='undef'
  930. Xelse
  931. X    $echo "No getpw() found--will use getpwent() instead."
  932. X    getpwent='define'
  933. Xfi
  934. Xfi
  935. X
  936. X: default
  937. Xsigret=int
  938. X: determine type of signal function
  939. Xif [ -f /usr/include/signal.h ]
  940. Xthen
  941. X    $cpp /usr/include/signal.h >sigtest
  942. Xelse
  943. Xif [ -f /usr/include/sys/signal.h ]
  944. Xthen
  945. X    $cpp /usr/include/sys/signal.h >sigtest
  946. Xfi
  947. Xfi
  948. Xif grep "$WHITE*void$WHITE*(\*signal())();" sigtest >/dev/null
  949. Xthen
  950. X    sigret=void
  951. Xfi
  952. X$echo "signal() returns $sigret on this system"
  953. X: see how we will look up site name
  954. Xdouname=undef
  955. Xgethostname=undef
  956. Xphostname=undef
  957. Xif $test ! "X$hostfile" = X ; then
  958. X    gethostname=define
  959. Xelse
  960. Xif $test "X$hostcmd" = X ; then
  961. X    : it is already compiled in
  962. Xelse
  963. Xif $contains gethostname.o libc.list >/dev/null 2>&1 ; then
  964. X    $echo "gethostname() found."
  965. X    gethostname=define
  966. Xelse
  967. X    if $contains uname.o libc.list >/dev/null 2>&1 ; then
  968. X    $echo "uname() found."
  969. X    douname=define
  970. X    else
  971. X    case $hostcmd in
  972. X      '') ;;
  973. X      *)
  974. X        $cat <<EOT
  975. XThere is no gethostname() or uname() on this system.  You have two
  976. Xpossibilites at this point:
  977. X
  978. X1)  You can have your site name ($sitename) compiled into trn, which lets
  979. X    trn start up faster, but makes your binaries non-portable, or
  980. X2)  you can have trn use a
  981. X    
  982. X    popen("$hostcmd","r")
  983. X
  984. X    which will start slower but be more portable.
  985. X
  986. XOption 1 will use whoami.h if you have one.  If you want option 2 but with
  987. Xa different command, you can edit config.h after this shell script is done.
  988. X
  989. XEOT
  990. X        case "$phostname" in
  991. X        define) dflt=n;;
  992. X        undef)  dflt=y;;
  993. X        '')
  994. X        case $portable in
  995. X        define) dflt=n ;;
  996. X        *)      dflt=y ;;
  997. X        esac
  998. X        ;;
  999. X        esac
  1000. X        $echo $n "Do you want your site name compiled in? [$dflt] $c"
  1001. X        . myread
  1002. X        case $ans in
  1003. X        '') ans=$dflt;;
  1004. X        esac
  1005. X        case $ans in
  1006. X          n*) phostname=define ;;
  1007. X          *)  hostcmd='' phostname=undef;;
  1008. X        esac
  1009. X        ;;
  1010. X    esac
  1011. X    case $hostcmd in
  1012. X      '')
  1013. X        case $whoami in
  1014. X          define)
  1015. X        $echo 'No hostname function--using whoami.h.'
  1016. X        ;;
  1017. X          undef)
  1018. X        $echo 'No hostname function--hardwiring "'$sitename'".'
  1019. X        ;;
  1020. X        esac
  1021. X        ;;
  1022. X    esac
  1023. X    fi
  1024. Xfi
  1025. Xfi
  1026. Xfi
  1027. X
  1028. X: see if we need -ljobs and if we have sigset, etc.
  1029. Xif $test -r /usr/lib/libjobs.a || $test -r /usr/local/lib/libjobs.a ; then
  1030. X    $echo "Jobs library found."
  1031. X    normsig=undef
  1032. X    jobslib='-ljobs'
  1033. Xelse
  1034. X    if bsd; then
  1035. X    $echo "No jobs library found.  (I suppose this is at least 4.2...)"
  1036. X    else
  1037. X    $echo "No jobs library found.  (That's okay, we all have our faults.)"
  1038. X    fi
  1039. X    normsig=define
  1040. X    jobslib=''
  1041. Xfi
  1042. X: set the right options for cc and include the x library for XENIX
  1043. Xif xenix; then
  1044. X    if $test -d /lib/386 ; then
  1045. X    iandd="-M3e"
  1046. X    else
  1047. X:    iandd="-M2let8 -LARGE -F 3000"
  1048. X    iandd="-Ml2et32 -LARGE -F B000"
  1049. X    fi
  1050. X    jobslib=-lx
  1051. X    chsize=define
  1052. Xelse
  1053. Xif $test -r /lib/libx.a ; then
  1054. X    $echo "Found Xenix library; using chsize()"
  1055. X    jobslib=-lx
  1056. X    chsize=define
  1057. Xelse
  1058. X    chsize=undef
  1059. Xfi
  1060. Xfi
  1061. X: No Steve jokes...
  1062. Xif next; then
  1063. X    jobslib='-lsys_s'
  1064. Xfi
  1065. X: see if there are directory access routines out there
  1066. Xif $test -r /usr/lib/libndir.a || $test -r /usr/local/lib/libndir.a ; then
  1067. X    $echo "Ndir library found."
  1068. X    if $test -r /usr/lib/libndir.a; then
  1069. X    ndirlib='-lndir'
  1070. X    else
  1071. X    ndirlib="/usr/local/lib/libndir.a"
  1072. X    fi
  1073. X    libndir=define
  1074. X    usendir=undef
  1075. X    ndirc=''
  1076. X    ndiro=''
  1077. X    dirtype=direct
  1078. Xelse
  1079. X    ndirlib=''
  1080. X    libndir=undef
  1081. X    if $contains readdir.o libc.list >/dev/null 2>&1 ; then
  1082. X    $echo "No ndir library found, but you have readdir() so we'll use that."
  1083. X    usendir=undef
  1084. X    ndirc=''
  1085. X    ndiro=''
  1086. X    if sgi ; then
  1087. X        dirtype=direct
  1088. X        dirinc="<sys/dir.h>"
  1089. X        $echo "Using direct directory structure."
  1090. X    else 
  1091. X        if $test -r /usr/include/dirent.h ; then
  1092. X            $echo "Using dirent directory structure."
  1093. X                dirtype=dirent
  1094. X            dirinc="<dirent.h>"
  1095. X        else
  1096. X            $echo "Using direct directory structure."
  1097. X                dirtype=direct
  1098. X            dirinc="<sys/dir.h>"
  1099. X        fi
  1100. X    fi
  1101. X     else
  1102. X    if xenix; then
  1103. X        $echo "Using Xenix readdir() from -lx."
  1104. X        usendir=undef
  1105. X        ndirc=''
  1106. X        ndiro=''
  1107. X        dirtype=direct
  1108. X        dirinc="<sys/ndir.h>"
  1109. X        $echo "Using direct directory structure."
  1110. X    else
  1111. X        $echo "No ndir library and no readdir()--using ./ndir.c."
  1112. X        usendir=define
  1113. X        ndirc='ndir.c'
  1114. X        ndiro='ndir.o'
  1115. X        dirtype=direct
  1116. X    fi
  1117. X    fi
  1118. Xfi
  1119. X
  1120. X: check if they want threads by default
  1121. Xcase "$threaddef" in
  1122. X    F*) dflt="n";;
  1123. X    *)  dflt="y";;
  1124. Xesac
  1125. X$cat <<EOT
  1126. X
  1127. XTrn has two distinct operating modes (selected by the -x option):
  1128. Xtraditional rn and threaded rn.  If you like, trn will check the first
  1129. Xletter of the command name and default to threaded mode (-x) if it is
  1130. Xa 't', or run as traditional rn (+x) if it isn't (this lets you install
  1131. Xas both trn and rn, linked together).  Otherwise, you can install trn
  1132. Xto default to threaded rn (-x) no matter what its name is.  Would you
  1133. XEOT
  1134. X$echo $n "prefer the latter? (defaults to -x, regardless of name)? [$dflt] $c"
  1135. X. myread
  1136. Xcase "$ans" in
  1137. X'') ans="$dflt";;
  1138. Xesac
  1139. Xcase "$ans" in
  1140. X    n*|f*) threaddef='FALSE'
  1141. X       ans=' when -x is specified';;
  1142. X    *)     threaddef='TRUE'
  1143. X       ans='';;
  1144. Xesac
  1145. X: check if they want the thread selector used by default
  1146. Xcase "$selectdef" in
  1147. X    F*) dflt="n";;
  1148. X    *)  dflt="y";;
  1149. Xesac
  1150. X$cat <<EOT
  1151. X
  1152. XWhen the -X option is specified, trn will set the default command
  1153. Xfor starting a newsgroup to be the thread selector.  Should the -X
  1154. XEOT
  1155. X$echo $n "option be on by default$ans? [$dflt] $c"
  1156. X. myread
  1157. Xcase "$ans" in
  1158. X'') ans="$dflt";;
  1159. Xesac
  1160. Xcase "$ans" in
  1161. X    n*|f*) selectdef='FALSE';;
  1162. X    *)     selectdef='TRUE';;
  1163. Xesac
  1164. X
  1165. X: locate spool directory and check if rrn
  1166. Xcase "$isrrn" in
  1167. Xdefine)
  1168. X    dflt="y";;
  1169. X*)
  1170. X    dflt="n";;
  1171. Xesac
  1172. Xisrrn=''
  1173. Xwhile $test -z "$isrrn" ; do
  1174. X    $echo " "
  1175. X    $echo $n "Do you want to build the NNTP versions of trn (trrn) and mthreads? [$dflt] $c"
  1176. X    . myread
  1177. X    case "$ans" in
  1178. X    '') ans="$dflt";;
  1179. X    esac
  1180. X    case "$ans" in
  1181. X    n*)
  1182. X    isrrn=undef;;
  1183. X    y*)
  1184. X    isrrn=define
  1185. X    spool=/tmp
  1186. X    $echo "net.foobar 00001 00001 y" > .falseactive
  1187. X
  1188. X    case "$serverfile" in
  1189. X    '')  dflt="no default" ;;
  1190. X    *)   dflt="$serverfile";;
  1191. X    esac
  1192. X
  1193. X    $cat <<'EOM'
  1194. X
  1195. XTrrn determines the machine to use as a news server by two means:
  1196. X
  1197. X    1. It examines the environment variable NNTPSERVER for
  1198. X       a machine name; this allows users to use server machines
  1199. X       other than the default.
  1200. X
  1201. X    2. It looks in a file which contains the name of a server
  1202. X       machine.
  1203. X
  1204. XYou must create the file mentioned in (2), above.  Simply put the name
  1205. Xof the machine you wish to use as your news server in this file.
  1206. XIf you really want, you can use # for comments and blank lines in
  1207. Xthis file as well.
  1208. X
  1209. XEOM
  1210. X
  1211. X    ans='blurfl/dyick'
  1212. X    while $test ! -r "$ans" ; do
  1213. X    $echo $n "Enter the name of the news server file: [$dflt] $c"
  1214. X    . myread
  1215. X        case "$ans" in
  1216. X        '') ans="$dflt";;
  1217. X        esac
  1218. X        ans=`filexp "$ans"`
  1219. X        if $test ! -r $ans ; then
  1220. X        $echo "Can't find $ans"
  1221. X        ans='blurfl/dyick'
  1222. X        fi
  1223. X    done
  1224. X    serverfile="$ans"
  1225. X
  1226. X    case "$NNTPSRC" in
  1227. X    '') dflt="no default";;
  1228. X    *)  dflt="$NNTPSRC";;
  1229. X    esac
  1230. X
  1231. X    ans='blurfl/dyick'
  1232. X    while $test ! -d "$ans"; do
  1233. X        $echo $n "Enter the pathname of the NNTP source directory: [$dflt] $c"
  1234. X        . myread
  1235. X        case "$ans" in
  1236. X        '') ans="$dflt";;
  1237. X        esac
  1238. X        ans=`filexp "$ans"`
  1239. X        if $test ! -r $ans/common/nntp.h ; then
  1240. X        $echo "Can't find $ans/common/nntp.h!"
  1241. X        ans='blurfl/dyick'
  1242. X        fi
  1243. X    done
  1244. X    NNTPSRC="$ans"
  1245. Xcat > server.h <<EOF_SERVE
  1246. X#ifdef SERVER
  1247. X
  1248. XEXT    char    *getserverbyfile();
  1249. XEXT    int    server_init();
  1250. XEXT    void    put_server();
  1251. XEXT    int    get_server();
  1252. XEXT    void    close_server();
  1253. X
  1254. X#include "$NNTPSRC/common/nntp.h"
  1255. X#endif
  1256. XEOF_SERVE
  1257. X
  1258. X    esac
  1259. X
  1260. Xdone
  1261. X: hack for Unisys NET-5000 and Interactive V/386
  1262. Xcase "$isrrn" in
  1263. Xdefine) 
  1264. X: NET-5000
  1265. X    if $test -d /usr/include/NET-5000 ; then
  1266. X    $echo "I sense you are on a Unisys 5000 computer...poor soul."
  1267. X    rrninclude="-I/usr/include/NET-5000 -DEXCELAN -DUSG"
  1268. X    socketlib=-lsocket
  1269. X    fi
  1270. X: Interactive Unix
  1271. X    if $test -f /usr/lib/libinet.a ; then
  1272. X    rrninclude="-DUSG"
  1273. X    socketlib=-linet
  1274. X    fi
  1275. X    ;;
  1276. X*) ;;
  1277. Xesac
  1278. X
  1279. X
  1280. Xcase "$spool" in
  1281. X'')
  1282. X    dflt=/usr/spool/news
  1283. X    ;;
  1284. X*)  dflt="$spool";;
  1285. Xesac
  1286. Xcase "$isrrn" in
  1287. Xdefine)  ans=/tmp;;
  1288. X*) ans='blurfl/dyick';;
  1289. Xesac
  1290. Xwhile $test ! -d $ans; do
  1291. X    $echo " "
  1292. X    case "$ans" in
  1293. X    blurfl*);;
  1294. X    *) $echo "Directory $ans not found.";;
  1295. X    esac
  1296. X    $echo $n "Where is news spooled (~name ok)? [$dflt] $c"
  1297. X    . myread
  1298. X    case "$ans" in
  1299. X    '') ans="$dflt";;
  1300. X    esac
  1301. X    spool="$ans"
  1302. X    case $spool in
  1303. X    ~*)
  1304. X    ans=`filexp $spool`
  1305. X    $echo "(That is $ans on this particular system.)"
  1306. X    case $portable in
  1307. X      undef) spool=$ans ;;
  1308. X    esac
  1309. X    ;;
  1310. X    *)
  1311. X    ans=$spool
  1312. X    ;;
  1313. X    esac
  1314. Xdone
  1315. X
  1316. X: check on .thread file placement
  1317. Xcase "$isrrn" in
  1318. Xdefine) 
  1319. X    case "$threaddir" in
  1320. X    ''|'.')    dflt="/usr/spool/threads";;
  1321. X    *)        dflt="$threaddir";;
  1322. X    esac
  1323. X    $echo " "
  1324. X    $echo "Pick a directory where you would like the thread files to"
  1325. X    $echo $n "be placed: [$dflt] $c"
  1326. X    . myread
  1327. X    case "$ans" in
  1328. X    ''|'.') ans="$dflt";;
  1329. X    esac
  1330. X    ;;
  1331. X*)
  1332. X    case "$threaddir" in
  1333. X    ''|'.')    dflt=".";;
  1334. X    *)        dflt="$threaddir";;
  1335. X    esac
  1336. X    $cat <<EOT
  1337. X
  1338. XBy default we place each group's .thread file in the same spool
  1339. Xdirectory as the article files.  Alternately, you can place the
  1340. Xdata files in a separate directory if space is tight on the news
  1341. Xdrive.  Where would you like them put?  (use '.' to specify the
  1342. XEOT
  1343. X    $echo $n "default): [$dflt] $c"
  1344. X    . myread
  1345. X    case "$ans" in
  1346. X    '') ans="$dflt";;
  1347. X    esac
  1348. X    ;;
  1349. Xesac
  1350. Xthreaddir="$ans"
  1351. X
  1352. X: locate active file
  1353. Xcase "$active" in
  1354. X'')
  1355. X    dflt=$lib/active
  1356. X    ;;
  1357. X*)  dflt="$active";;
  1358. Xesac
  1359. Xcase "$isrrn" in
  1360. Xdefine) myactive=.falseactive;;
  1361. X*) myactive='blurfl/dyick'
  1362. Xesac
  1363. Xwhile $test ! -f "$myactive"; do
  1364. X    $echo " "
  1365. X    case "$myactive" in
  1366. X    blurfl*);;
  1367. X    *) "File $myactive not found.";;
  1368. X    esac
  1369. X    $echo $n "Where is the active file (~name ok)? [$dflt] $c"
  1370. X    . myread
  1371. X    case "$ans" in
  1372. X    '') ans="$dflt";;
  1373. X    esac
  1374. X    active="$ans"
  1375. X    case $active in
  1376. X    ~*)
  1377. X    myactive=`filexp $active`
  1378. X    $echo "(That is $myactive on this particular system.)"
  1379. X    case $portable in
  1380. X      undef) active=$myactive ;;
  1381. X    esac
  1382. X    ;;
  1383. X    *)
  1384. X    myactive=$active
  1385. X    ;;
  1386. X    esac
  1387. X    if $test -d $myactive ; then
  1388. X    myactive=$myactive/active
  1389. X    active=$active/active
  1390. X    fi
  1391. Xdone
  1392. X
  1393. X: check for 2.10.2 and above
  1394. X$echo " "
  1395. Xif $contains ' [0-9][0-9]* [0-9]' "$myactive" >/dev/null 2>&1; then
  1396. X    case "$norelay" in
  1397. X    undef) dflt="y";;
  1398. X    *)     dflt="n";;
  1399. X    esac
  1400. X    case "$isrrn" in
  1401. X    define) 
  1402. X       $echo "Is your NNTP server running an old version of news software," ;;
  1403. X    *) $echo "Is your system running an old version of news software," ;;
  1404. X    esac
  1405. X    $echo $n "predating B News 2.10.3? [${dflt}] $c" 
  1406. X    . myread
  1407. X    case "$ans" in
  1408. X    '') ans=$dflt;;
  1409. X    esac
  1410. X    case "$ans" in
  1411. X    y*)
  1412. X      norelay='undef'
  1413. X    $echo "Looks like you are running at least 2.10.2 news."
  1414. X      ;;
  1415. X    *)  norelay='define' ;;
  1416. X    esac
  1417. X    mininact=define
  1418. Xelse
  1419. X    $echo "It doesn't look like you are running 2.10.2 news yet.  Are you planning"
  1420. X    $echo $n "to install it in the near future? [y] $c"
  1421. X    . myread
  1422. X    case $ans in
  1423. X    n*) mininact=undef ;;
  1424. X    *)  mininact=define ;;
  1425. X    esac
  1426. X    norelay='undef'
  1427. Xfi
  1428. X
  1429. X
  1430. X: check for void type
  1431. X$echo " "
  1432. X$echo "Checking to see if your C compiler groks the void type..."
  1433. X$cat >try.c <<'EOCP'
  1434. Xvoid main();
  1435. XEOCP
  1436. Xif cc -c try.c >/dev/null 2>&1 ; then
  1437. X    novoid='undef'
  1438. X    $echo "Yup, it does."
  1439. Xelse
  1440. X    novoid='define'
  1441. X    $echo "Nope, it doesn't (boo hiss).  I will substitute int."
  1442. Xfi
  1443. X$rm try.*
  1444. X
  1445. X: find out which shell people like to use most
  1446. Xans='blurfl/dyick'
  1447. Xwhile $test ! -f "$ans" ; do
  1448. X    case $ans in
  1449. X      blurfl*) ;;
  1450. X      *) $echo "$ans does not appear to exist." ;;
  1451. X    esac
  1452. X    case "$pref" in
  1453. X    '')
  1454. X    if $test -f /bin/ksh; then
  1455. X        dflt='/bin/ksh'
  1456. X    else
  1457. X        if $test -f /bin/csh; then
  1458. X        dflt='/bin/csh'
  1459. X        else
  1460. X        dflt='/bin/sh'
  1461. X        fi
  1462. X    fi
  1463. X    ;;
  1464. X    *)  dflt="$pref";;
  1465. X    esac
  1466. X    $echo " "
  1467. X    $echo "Give the full path name of the shell most people like to use on your"
  1468. X    $echo $n "system: [$dflt] $c"
  1469. X    . myread
  1470. X    case $ans in
  1471. X      '') ans=$dflt ;;
  1472. X    esac
  1473. Xdone
  1474. Xpref=$ans
  1475. X
  1476. X: locate the preferred pager for this system
  1477. Xcase "$pager" in
  1478. X'')
  1479. X    case $pg in
  1480. X    /*) dflt=$pg
  1481. X    ;;
  1482. X    esac
  1483. X    case $more in
  1484. X    /*) dflt=$more
  1485. X    ;;
  1486. X    esac
  1487. X    case $dflt in
  1488. X    '') dflt=/usr/ucb/more
  1489. X    ;;
  1490. X    esac
  1491. X    ;;
  1492. X*)  dflt="$pager";;
  1493. Xesac
  1494. Xpager='blurfl/dyick'
  1495. Xwhile $test ! -f "$pager" ; do
  1496. X    case $pager in
  1497. X      blurfl*)
  1498. X    $echo " "
  1499. X    $echo "(If your kernel does terminal paging then you may answer this with '/bin/cat'.)"
  1500. X    ;;
  1501. X      /*) $echo "$pager does not appear to exist."
  1502. X    $echo " "
  1503. X        ;;
  1504. X      *) $echo "Please give the full path name."
  1505. X    $echo " "
  1506. X        ;;
  1507. X    esac
  1508. X    $echo $n "What pager is used on your system? [$dflt] $c"
  1509. X    . myread
  1510. X    pager="$ans"
  1511. X    case $pager in
  1512. X      '') pager="$dflt" ;;
  1513. X    esac
  1514. Xdone
  1515. X
  1516. X: determine default editor
  1517. Xcase "$defeditor" in
  1518. X'')
  1519. X    dflt=`loc vi /usr/ucb $pth`
  1520. X    ;;
  1521. X*)  dflt="$defeditor"
  1522. X    ;;
  1523. Xesac
  1524. Xdefeditor='blurfl/dyick'
  1525. Xwhile $test ! -f "$defeditor" ; do
  1526. X    case $defeditor in
  1527. X      blurfl*) ;;
  1528. X      *) $echo "$defeditor does not appear to exist." ;;
  1529. X    esac
  1530. X    $echo " "
  1531. X    $echo $n "What is the default editor on your system? [$dflt] $c"
  1532. X    . myread
  1533. X    defeditor="$ans"
  1534. X    case $defeditor in
  1535. X      '') defeditor=$dflt ;;
  1536. X    esac
  1537. Xdone
  1538. X
  1539. X: determine mailer for Rnmail to use
  1540. X$echo " "
  1541. Xif $test ! -f "$mailer"; then
  1542. X    mailer=
  1543. X    for x in /usr/lib/sendmail /bin/smail /usr/bin/smail \
  1544. X         /usr/lib/mail/execmail; do
  1545. X    if $test "$mailer" = "" -a -f $x; then
  1546. X        mailer=$x
  1547. X    fi
  1548. X    done
  1549. X    if $test ! -f "$mailer"; then
  1550. X    if usg && $test -f $libexp/recmail; then
  1551. X        mailer=$libexp/recmail
  1552. X    else
  1553. X        if s5uniq && $test -f /usr/bin/mailx; then
  1554. X        mailer=/usr/bin/mailx
  1555. X        else
  1556. X        mailer=/bin/mail
  1557. X        fi
  1558. X    fi
  1559. X    fi
  1560. Xfi
  1561. X$echo "Mail sender is $mailer"
  1562. X
  1563. X: check for internet mailer
  1564. Xcase "$internet" in
  1565. Xdefine) dflt=y;;
  1566. Xundef)    dflt=n;;
  1567. X*)
  1568. X    case "$isrrn" in
  1569. X    define) dflt=y ;;
  1570. X    *) dflt=n ;;
  1571. X    esac
  1572. X    ;;
  1573. Xesac
  1574. Xcat <<EOM
  1575. XSome newer mailers can deliver mail to addresses of the INTERNET persuasion,
  1576. Xsuch as user@host.UUCP.  Other older mailers require the complete path to
  1577. Xthe destination to be specified in the address.  Does your mailer understand
  1578. XEOM
  1579. X$echo $n "INTERNET addresses? [$dflt] $c"
  1580. X. myread
  1581. Xcase "$ans" in
  1582. X'') ans=$dflt;;
  1583. Xesac
  1584. Xcase "$ans" in
  1585. Xy*) internet=define;;
  1586. X*)  internet=undef;;
  1587. Xesac
  1588. X
  1589. X: determine where public executables go
  1590. Xcase "$rnbin" in
  1591. X'')
  1592. X    dflt=`loc . /bin /usr/local/bin /usr/lbin /usr/local /usr/bin`
  1593. X    ;;
  1594. X*)  dflt="$rnbin"
  1595. X    ;;
  1596. Xesac
  1597. Xrnbin='blurfl/dyick'
  1598. Xwhile $test ! -d "$rnbin" ; do
  1599. X    case $rnbin in
  1600. X      blurfl*) ;;
  1601. X      *) $echo "$rnbin does not appear to exist." ;;
  1602. X    esac
  1603. X    $echo " "
  1604. X    $echo $n "Where do you want to put the public executables? [$dflt] $c"
  1605. X    . myread
  1606. X    rnbin="$ans"
  1607. X    rnbin=`filexp $rnbin`
  1608. X    case $rnbin in
  1609. X      '') rnbin=$dflt ;;
  1610. X    esac
  1611. Xdone
  1612. X
  1613. X: determine where private executables go
  1614. Xcase "$rnlib" in
  1615. X'')
  1616. X    case "$isrrn" in
  1617. X    define) dflt=/usr/local/lib/trn ;;
  1618. X    *) dflt=$lib/trn ;;
  1619. X    esac
  1620. X    ;;
  1621. X*)  dflt="$rnlib"
  1622. X    ;;
  1623. Xesac
  1624. X$echo " "
  1625. X$echo "Trn has a number of auxiliary programs that need not be visible to the"
  1626. X$echo "whole world.  Where do you want to put these private executables?"
  1627. X$echo $n "[$dflt] (~name ok) $c"
  1628. X. myread
  1629. Xrnlib="$ans"
  1630. Xcase $rnlib in
  1631. X  '') rnlib=$dflt ;;
  1632. Xesac
  1633. Xcase $portable in
  1634. Xundef)
  1635. X    rnlib=`filexp $rnlib`
  1636. X    ;;
  1637. Xesac
  1638. X: must not allow self reference
  1639. Xcase $rnlib in
  1640. X  /*)
  1641. X    filexp=$rnlib/filexp
  1642. X    ;;
  1643. X  *)
  1644. X    filexp=`pwd`/filexp
  1645. X    ;;
  1646. Xesac
  1647. X
  1648. X: get the local distribution prefixes
  1649. Xif $test -f $libexp/sys ; then
  1650. X    $sed <$libexp/sys -n -e "s/^$sitename://p" | \
  1651. X    $sed -e "s/:.*//" -e "s/,/ /g" | tr ' ' '\012' | \
  1652. X    $sed -e "/^to./d" -e "/^net$/d" -e "/^fa$/d" -e "/^mod$/d" > .distlist
  1653. Xfi
  1654. X
  1655. X$cat <<'EOH'
  1656. XDistribution groups are the things you use on the Distribution line to limit
  1657. Xwhere an article will go to.  You are likely to be a member of several
  1658. Xdistribution groups, such as organization, city, state, province, country,
  1659. Xcontinent, etc.  For example, Los Angeles has the distribution prefix "la",
  1660. XNew Jersey has the prefix "nj", and Europe has the prefix "eunet".
  1661. X
  1662. XThe categories you will be asked are: 
  1663. X
  1664. Xlocal organization    (Could be just one machine or a cluster or an office)
  1665. Xorganization        att, dec, kgb, ...
  1666. Xcity            la, ny, mosc, ...
  1667. Xstate/province        ca, nj, bc, ...
  1668. Xcountry            usa, can, rok, whatever
  1669. Xcontinent        na (North America, not "Not Applicable"), asia, etc.
  1670. X
  1671. X(If you don't have a distribution prefix in any of these categories then
  1672. Xjust hit return.)
  1673. X
  1674. XEOH
  1675. Xif $test -f .distlist; then
  1676. X    distlist=`tr '\012' ' ' <.distlist`
  1677. X    if $test "$distlist" ; then
  1678. X    $echo "(These are the distributions in your sys file: $distlist)"
  1679. X    $echo " "
  1680. X    fi
  1681. Xfi
  1682. Xcase "$locpref" in
  1683. X'') dflt="";;
  1684. X*)  dflt="[$locpref] ";;
  1685. Xesac
  1686. X$echo $n "What is the distribution prefix for your local organization? $dflt$c"
  1687. X. myread
  1688. Xcase "$ans" in
  1689. X'') ;;
  1690. X*)  locpref="$ans";;
  1691. Xesac
  1692. Xcase $locpref in
  1693. X  '') locpref=none ;;
  1694. Xesac
  1695. Xcase "$orgpref" in
  1696. X'') dflt="";;
  1697. X*)  dflt="[$orgpref] ";;
  1698. Xesac
  1699. X$echo $n "What is the distribution prefix for your organization? $dflt$c"
  1700. X. myread
  1701. Xcase "$ans" in
  1702. X'') ;;
  1703. X*)  orgpref="$ans";;
  1704. Xesac
  1705. Xcase $orgpref in
  1706. X  '') orgpref=none ;;
  1707. Xesac
  1708. Xcase "$citypref" in
  1709. X'') dflt="";;
  1710. X*)  dflt="[$citypref] ";;
  1711. Xesac
  1712. X$echo $n "What is the distribution prefix for your city? $dflt$c"
  1713. X. myread
  1714. Xcase "$ans" in
  1715. X'') ;;
  1716. X*)  citypref="$ans";;
  1717. Xesac
  1718. Xcase $citypref in
  1719. X  '') citypref=none ;;
  1720. Xesac
  1721. Xcase "$statepref" in
  1722. X'') dflt="";;
  1723. X*)  dflt="[$statepref] ";;
  1724. Xesac
  1725. X$echo $n "What is the distribution prefix for your state/province? $dflt$c"
  1726. X. myread
  1727. Xcase "$ans" in
  1728. X'') ;;
  1729. X*)  statepref="$ans";;
  1730. Xesac
  1731. Xcase $statepref in
  1732. X  '') statepref=none ;;
  1733. Xesac
  1734. Xcase "$cntrypref" in
  1735. X'') dflt="";;
  1736. X*)  dflt="[$cntrypref] ";;
  1737. Xesac
  1738. X$echo $n "What is the distribution prefix for your country? $dflt$c"
  1739. X. myread
  1740. Xcase "$ans" in
  1741. X'') ;;
  1742. X*)  cntrypref="$ans";;
  1743. Xesac
  1744. Xcase $cntrypref in
  1745. X  '') cntrypref=none ;;
  1746. Xesac
  1747. Xcase "$contpref" in
  1748. X'') dflt="";;
  1749. X*)  dflt="[$contpref] ";;
  1750. Xesac
  1751. X$echo $n "What is the distribution prefix for your continent? $dflt$c"
  1752. X. myread
  1753. Xcase "$ans" in
  1754. X'') ;;
  1755. X*)  contpref="$ans";;
  1756. Xesac
  1757. Xcase $contpref in
  1758. X  '') contpref=none ;;
  1759. Xesac
  1760. X
  1761. X$echo " "
  1762. X$echo "If you have any other distribution groups you will need to edit Pnews"
  1763. X$echo "and newsetup to add them."
  1764. X$echo " "
  1765. X
  1766. X: determine root id
  1767. Xrootid=`$sed </etc/passwd -e "/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*"'$'"/\1/" -e "q" -e "}" -e "d"`
  1768. Xcase $rootid in
  1769. X  '') rootid=0 ;;
  1770. X  *)  $echo "Root uid = $rootid" ;;
  1771. Xesac
  1772. X
  1773. X: weed out incompatibilities
  1774. Xcase $douname in
  1775. X  define) whoami=undef ;;
  1776. Xesac
  1777. X
  1778. X: preserve RCS keywords in files with variable substitution, grrr
  1779. XLog='$Log'
  1780. XHeader='$Header'
  1781. X
  1782. X: Warnings
  1783. Xif v7; then
  1784. X    cat <<'EOM'
  1785. XNOTE: the V7 compiler may ignore some #undefs that trn uses.  If so, you will
  1786. Xget messages about redefining EXT.  Some V7 compilers also have difficulties
  1787. Xwith #defines near buffer boundaries, so beware.  You may have to play with
  1788. Xthe spacing in common.h.
  1789. XEOM
  1790. Xfi
  1791. X
  1792. Xif pdp11; then
  1793. X    cat <<'EOM'
  1794. XNOTE: the PDP-11 does not have enough data space to do subject caching
  1795. Xreliably.  That feature will be disabled automatically.  Subject searching
  1796. Xwill tend to be slow.
  1797. XEOM
  1798. Xfi
  1799. Xcase "$isrrn" in
  1800. X    define) ;;
  1801. X    *) socketlib=""
  1802. X       rrninclude=""
  1803. X     ;;
  1804. Xesac
  1805. X
  1806. X$echo " "
  1807. X$echo "End of configuration questions."
  1808. X$echo " "
  1809. X
  1810. X: create config.sh file
  1811. X$echo " "
  1812. X$echo "Creating config.sh..."
  1813. X$spitshell <<EOT >config.sh
  1814. X$startsh
  1815. X# config.sh
  1816. X# This file was produced by running the Configure script.
  1817. X
  1818. Xn='$n'
  1819. Xc='$c'
  1820. Xlibc='$libc'
  1821. Xeunicefix='$eunicefix'
  1822. Xeunice='$eunice'
  1823. Xcpp='$cpp'
  1824. Xshsharp='$shsharp'
  1825. Xstartsh='$startsh'
  1826. Xspitshell='$spitshell'
  1827. Xtest='$test'
  1828. Xexpr='$expr'
  1829. Xsed='$sed'
  1830. Xecho='$echo'
  1831. Xcat='$cat'
  1832. Xrm='$rm'
  1833. Xmv='$mv'
  1834. Xcp='$cp'
  1835. Xtail='$tail'
  1836. Xtr='$tr'
  1837. Xmkdir='$mkdir'
  1838. Xsort='$sort'
  1839. Xuniq='$uniq'
  1840. Xinews='$inews'
  1841. Xgrep='$grep'
  1842. Xegrep='$egrep'
  1843. Xnidump='$nidump'
  1844. Xypmatch='$ypmatch'
  1845. Xcontains='$contains'
  1846. Xlib='$lib'
  1847. Xlibexp='$libexp'
  1848. Xnametype='$nametype'
  1849. Xcc='$cc'
  1850. Xiandd='$iandd'
  1851. Xinclude='$include'
  1852. Xrrninclude='$rrninclude'
  1853. Xtermlib='$termlib'
  1854. Xjobslib='$jobslib'
  1855. Xsocketlib='$socketlib'
  1856. Xgetcwd='$getcwd'
  1857. Xgetwd='$getwd'
  1858. Xdirtype='$dirtype'
  1859. Xndirlib='$ndirlib'
  1860. Xlibndir='$libndir'
  1861. Xusendir='$usendir'
  1862. Xndirc='$ndirc'
  1863. Xndiro='$ndiro'
  1864. Xpager='$pager'
  1865. Xmailer='$mailer'
  1866. Xinternet='$internet'
  1867. Xrnbin='$rnbin'
  1868. Xfilexp='$filexp'
  1869. Xdistlist='$distlist'
  1870. XLog='$Log'
  1871. XHeader='$Header'
  1872. Xsitename='$sitename'
  1873. Xhostfile='$hostfile'
  1874. Xdomain='$domain'
  1875. Xorgname='$orgname'
  1876. Xisadmin='$isadmin'
  1877. Xnewsadmin='$newsadmin'
  1878. Xrnlib='$rnlib'
  1879. Xmansrc='$mansrc'
  1880. Xmanext='$manext'
  1881. Xmaildir='$maildir'
  1882. Xspool='$spool'
  1883. Xactive='$active'
  1884. Xmyactive='$myactive'
  1885. Xmininact='$mininact'
  1886. Xpref='$pref'
  1887. Xdefeditor='$defeditor'
  1888. Xrootid='$rootid'
  1889. Xmboxchar='$mboxchar'
  1890. Xlocpref='$locpref'
  1891. Xorgpref='$orgpref'
  1892. Xcitypref='$citypref'
  1893. Xstatepref='$statepref'
  1894. Xcntrypref='$cntrypref'
  1895. Xcontpref='$contpref'
  1896. Xstrchr='$strchr'
  1897. Xmemcpy='$memcpy'
  1898. Xrename='$rename'
  1899. Xtruncate='$truncate'
  1900. Xchsize='$chsize'
  1901. Xtzset='$tzset'
  1902. Xthreaddef='$threaddef'
  1903. Xselectdef='$selectdef'
  1904. Xthreaddir='$threaddir'
  1905. Xnovoid='$novoid'
  1906. Xnovfork='$novfork'
  1907. Xportable='$portable'
  1908. Xpassnam='$passnam'
  1909. Xberknam='$berknam'
  1910. Xusgnam='$usgnam'
  1911. Xwhoami='$whoami'
  1912. Xtermio='$termio'
  1913. Xfcntl='$fcntl'
  1914. Xioctl='$ioctl'
  1915. Xptem='$ptem'
  1916. Xnormsig='$normsig'
  1917. Xsigblock='$sigblock'
  1918. Xsigret='$sigret'
  1919. Xgetuidgid='$getuidgid'
  1920. Xhavetlib='$havetlib'
  1921. Xgetpwent='$getpwent'
  1922. Xgethostname='$gethostname'
  1923. Xdouname='$douname'
  1924. Xphostname='$phostname'
  1925. Xhostcmd='$hostcmd'
  1926. Xnorelay='$norelay'
  1927. Xrdchk='$rdchk'
  1928. Xisrrn='$isrrn'
  1929. Xserverfile='$serverfile'
  1930. XNNTPSRC='$NNTPSRC'
  1931. XCONFIG=true
  1932. XCTRLA='$CTRLA'
  1933. Xhiddennet='$hiddennet'
  1934. XEOT
  1935. X
  1936. X: create config.h file
  1937. X$echo " "
  1938. X$echo "Creating config.h..."
  1939. Xcase "$threaddir" in
  1940. X'.')    threaddir='/usr/spool/threads'
  1941. X    tdir='/*';;
  1942. X*)    tdir='';;
  1943. Xesac
  1944. Xcase "$strchr" in
  1945. Xdefine)    strchr='';;
  1946. X*)    strchr='/*';;
  1947. Xesac
  1948. Xcase "$memcpy" in
  1949. Xdefine)    memcpy='';;
  1950. X*)    memcpy='/*';;
  1951. Xesac
  1952. Xcase "$novoid" in
  1953. Xdefine)    novoid='';;
  1954. X*)    novoid='/*';;
  1955. Xesac
  1956. Xcase "$novfork" in
  1957. Xdefine)    novfork='';;
  1958. X*)    novfork='/*';;
  1959. Xesac
  1960. Xcase "$phostname" in
  1961. Xdefine)    phostname='';;
  1962. X*)    phostname='/*';;
  1963. Xesac
  1964. Xcase "$isrrn" in
  1965. Xdefine)    isrrn2='';;
  1966. X*)    isrrn2='/*';;
  1967. Xesac
  1968. Xcase "$hostfile" in
  1969. X'')    usehostfile='/*';;
  1970. X*)    usehostfile='';;
  1971. Xesac
  1972. X$cat <<EOT >config.h
  1973. X/* config.h
  1974. X * This file was produced by running the Configure script.
  1975. X * Feel free to modify any of this as the need arises.
  1976. X */
  1977. X
  1978. X/* name of the site.  May be overridden by HOSTFILE, gethostname, uname, etc. */
  1979. X#define SITENAME "$sitename"
  1980. X$usehostfile#define HOSTFILE "$hostfile"
  1981. X
  1982. X/* domain name for the site */
  1983. X#define OURDOMAIN "$domain"
  1984. X
  1985. X/* name of the organization, may be a file name */
  1986. X#define ORGNAME "$orgname"
  1987. X
  1988. X/* login name of news administrator, if any. */
  1989. X#$isadmin NEWSADMIN "$newsadmin"
  1990. X
  1991. X/* news library, may use only ~ and %l expansion */
  1992. X#define LIB "$lib"
  1993. X
  1994. X/* rn private library, may use ~ expansion, %x and %l */
  1995. X#define RNLIB "$rnlib"
  1996. X
  1997. X/* location of the news spool directory, may use ~ expansion, %x and %l */
  1998. X#define SPOOL "$spool"
  1999. X
  2000. X/* put thread files in each spool directory, unless THREAD_DIR is defined */
  2001. X$tdir#define THREAD_DIR "$threaddir"    /* base directory */
  2002. X
  2003. X/* save in subdirectories unless LONG_THREAD_NAMES & THREAD_DIR are defined */
  2004. X#undef LONG_THREAD_NAMES        /* not for short-name systems */
  2005. X
  2006. X/* location of the active file, may use ~ expansion, %x and %l */
  2007. X#define ACTIVE "$active"
  2008. X
  2009. X/* location of spooled mail */
  2010. X#define MAILFILE "$maildir"
  2011. X
  2012. X/* default shell--ok to be a slow shell like csh */
  2013. X#define PREFSHELL "$pref"
  2014. X
  2015. X/* default editor */
  2016. X#define DEFEDITOR "$defeditor"
  2017. X
  2018. X/* root uid */
  2019. X#define ROOTID $rootid
  2020. X
  2021. X/* what is the first character of a mailbox? */
  2022. X#define MBOXCHAR '$mboxchar'
  2023. X
  2024. X/* how to cancel an article */
  2025. X#define CANCEL "$inews -h <%h"
  2026. X
  2027. X/* distribution groups */
  2028. X#define LOCDIST "$locpref"
  2029. X#define ORGDIST "$orgpref"
  2030. X#define CITYDIST "$citypref"
  2031. X#define STATEDIST "$statepref"
  2032. X#define CNTRYDIST "$cntrypref"
  2033. X#define CONTDIST "$contpref"
  2034. X
  2035. X#define THREAD_INIT $threaddef
  2036. X#define SELECT_INIT $selectdef
  2037. X
  2038. X$strchr#define index   strchr    /* cultural */
  2039. X$strchr#define rindex  strrchr    /*  differences? */
  2040. X$memcpy#define bcopy(s,d,n)    memcpy((char*)d,(char*)s,(int)n)    /* Different */
  2041. X$memcpy#define bzero(d,n)    memset((char*)d,0,(int)n)        /*  flavors. */
  2042. X#$rename    RENAME        /* is rename() a system call? */
  2043. X#$truncate    TRUNCATE    /* is truncate() available? */
  2044. X#$chsize    CHSIZE        /* is chsize() available? */
  2045. X#$tzset    TZSET        /* modern timezone functions? */
  2046. X$novoid#define void int    /* is void to be avoided? */
  2047. X$novfork#define vfork fork    /* is vfork too virtual? */
  2048. X#$eunice    EUNICE        /* no linking? */
  2049. X#$eunice    VMS        /* not currently used, here just in case */
  2050. X#$getcwd    GETCWD        /* do we have getcwd()? */
  2051. X#$getwd        GETWD        /* do we have getwd()? */
  2052. X#$usendir    USENDIR        /* include ndir.c? */
  2053. X#$libndir    LIBNDIR        /* include /usr/include/ndir.h? */
  2054. X#define    DIRTYPE   $dirtype
  2055. X#ifndef USENDIR
  2056. X#define    DIRINC      $dirinc
  2057. X#endif
  2058. X#$mininact    MININACT    /* include 2.10.2 optimization? */
  2059. X#$portable    PORTABLE    /* do we do extra lookups to start up? */
  2060. X#$passnam    PASSNAMES    /* do names come from the passwd file? */
  2061. X            /*  (undef to take name from ~/.fullname) */
  2062. X#$berknam    BERKNAMES    /* if so, are they Berkeley format? */
  2063. X            /* (that is, ":name,stuff:") */
  2064. X#$usgnam    USGNAMES    /* or are they USG format? */
  2065. X            /* (that is, ":stuff-name(stuff):") */
  2066. X#$whoami    WHOAMI        /* should we include whoami.h? */
  2067. X#$rdchk    RDCHK        /* do we have rdchk()? */
  2068. X#$termio    TERMIO        /* is this a termio system? */
  2069. X#$fcntl    FCNTL        /* should we include fcntl.h? */
  2070. X#$ioctl    IOCTL        /* are ioctl args all defined in one place? */
  2071. X#$ptem        PTEM        /* has the ptem.h include file ? */
  2072. X#$normsig    NORMSIG        /* use signal rather than sigset? */
  2073. X#$sigblock    SIGBLOCK    /* use sigblock and sigsetmask */
  2074. X#define    SIGRET    $sigret    /* what does signal() return? */
  2075. X#$havetlib    HAVETERMLIB    /* do we have termlib-style routines? */
  2076. X#$getuidgid    GETUIDGID    /* allow setuid (if possible) */
  2077. X#$getpwent    GETPWENT    /* should we include getpwent? */
  2078. X#$internet    INTERNET    /* does our mailer do INTERNET addressing? */
  2079. X#$gethostname    GETHOSTNAME    /* do we have a gethostname function? */
  2080. X#$douname    DOUNAME        /* do we have a uname function? */
  2081. X$phostname#define PHOSTNAME "$hostcmd"    /* how to get host name with popen */
  2082. X#$norelay    NORELAY        /* 2.10.3 doesn't have Relay-Version line */
  2083. X#$isrrn    SERVER        /* rrn server code */
  2084. X$isrrn2#define SERVER_FILE    "$serverfile"    /* news server file */
  2085. X#$hiddennet    HIDDENNET    /* hide the host inside the domain? */
  2086. XEOT
  2087. X
  2088. XCONFIG=true
  2089. X
  2090. X$rm -f libc.list .distlist kit*isdone 
  2091. X
  2092. X$echo " "
  2093. X$echo "Doing variable substitutions on various files..."
  2094. X$echo " "
  2095. Xset `$grep <MANIFEST '\.SH' | awk '{print $1}'`
  2096. Xfor file in $*; do
  2097. X    . $file
  2098. Xdone
  2099. X
  2100. X$echo " "
  2101. X$echo 'Now you need to generate make dependencies by running "makedepend".'
  2102. X$echo 'You might prefer to run it in background: "makedepend > makedepend.out &"'
  2103. X$echo $n "Would you like me to run it for you (it takes quite a while)? [n] $c" 
  2104. X. myread
  2105. Xcase "$ans" in
  2106. Xy*) makedepend;;
  2107. Xesac
  2108. X$rm -f myread
  2109. X: end of Configure
  2110. END_OF_FILE
  2111.   if test 43215 -ne `wc -c <'Configure.2'`; then
  2112.     echo shar: \"'Configure.2'\" unpacked with wrong size!
  2113.   fi
  2114.   # end of 'Configure.2'
  2115. fi
  2116. if test -f 'head.h' -a "${1}" != "-c" ; then 
  2117.   echo shar: Will not clobber existing file \"'head.h'\"
  2118. else
  2119.   echo shar: Extracting \"'head.h'\" \(3993 characters\)
  2120.   sed "s/^X//" >'head.h' <<'END_OF_FILE'
  2121. X/* $Header: head.h,v 4.3.3.2 91/01/16 02:41:17 davison Trn $
  2122. X *
  2123. X * $Log:    head.h,v $
  2124. X * Revision 4.3.3.2  91/01/16  02:41:17  davison
  2125. X * Added optional prototyping.
  2126. X * 
  2127. X * Revision 4.3.3.1  90/06/20  22:37:18  davison
  2128. X * Initial Trn Release
  2129. X * 
  2130. X * Revision 4.3  85/05/01  11:38:31  lwall
  2131. X * Baseline for release with 4.3bsd.
  2132. X * 
  2133. X */
  2134. X
  2135. X#define HEAD_FIRST 1
  2136. X
  2137. X/* types of header lines (if only C really believed in enums)
  2138. X * (These must stay in alphabetic order at least in the first letter.
  2139. X * Within each letter it helps to arrange in increasing likelihood.)
  2140. X */
  2141. X
  2142. X#define PAST_HEADER    0    /* body */
  2143. X#define SOME_LINE    1    /* unrecognized */
  2144. X#define ARTID_LINE    2    /* article-i.d. */
  2145. X#define APPR_LINE    3    /* approved */
  2146. X#define DIST_LINE    4    /* distribution */
  2147. X#define DATE_LINE    5    /* date */
  2148. X#define RECEIVED_LINE    6    /* date-received */
  2149. X#define EXPIR_LINE    7    /* expires */
  2150. X#define FOLLOW_LINE    8    /* followup-to */
  2151. X#define FROM_LINE    9    /* from */
  2152. X#define KEYW_LINE    10    /* keywords */
  2153. X#define LINES_LINE    11    /* lines */
  2154. X#define MESSID_LINE    12    /* message-id */
  2155. X#define NFFR_LINE    13    /* nf-from */
  2156. X#define NFID_LINE    14    /* nf-id */
  2157. X#define NGS_LINE    15    /* newsgroups */
  2158. X#define ORG_LINE    16    /* organization */
  2159. X#define PATH_LINE    17    /* path */
  2160. X#define POSTED_LINE    18    /* posted */
  2161. X#define PVER_LINE    19    /* posting-version */
  2162. X#define REPLY_LINE    20    /* reply-to */
  2163. X#define REFS_LINE    21    /* references */
  2164. X#define RVER_LINE    22    /* relay-version */
  2165. X#define SENDER_LINE    23    /* sender */
  2166. X#define SUMRY_LINE    24    /* summary */
  2167. X#define SUBJ_LINE    25    /* subject */
  2168. X#define XREF_LINE    26    /* xref */
  2169. X
  2170. X#define HEAD_LAST    27    /* one more than the last one above */
  2171. X
  2172. Xstruct headtype {
  2173. X    char *ht_name;        /* header line identifier */
  2174. X#ifdef pdp11
  2175. X    short ht_minpos;
  2176. X    short ht_maxpos;
  2177. X#else
  2178. X    ART_POS ht_minpos;        /* pointer to beginning of line in article */
  2179. X    ART_POS ht_maxpos;        /* pointer to end of line in article */
  2180. X#endif
  2181. X    char ht_length;        /* could make these into nybbles but */
  2182. X    char ht_flags;        /* it wouldn't save space normally */
  2183. X};                /* due to alignment considerations */
  2184. X
  2185. X#define HT_HIDE 1    /* -h on this line */
  2186. X#define HT_MAGIC 2    /* do any special processing on this line */
  2187. X
  2188. X/* This array must stay in the same order as the list above */
  2189. X
  2190. X#ifndef DOINIT
  2191. XEXT struct headtype htype[HEAD_LAST];
  2192. X#else
  2193. Xstruct headtype htype[HEAD_LAST] = {
  2194. X /* name             minpos   maxpos  length   flag */
  2195. X    {"BODY",        0,    0,    4,    0        },
  2196. X    {"unrecognized",    0,    0,    12,    0        },
  2197. X    {"article-i.d.",    0,    0,    12,    HT_HIDE        },
  2198. X    {"approved",    0,    0,    8,    HT_HIDE        },
  2199. X    {"distribution",    0,    0,    12,    0        },
  2200. X#ifdef USETHREADS
  2201. X    {"date",        0,    0,    4,    HT_MAGIC    },
  2202. X#else
  2203. X    {"date",        0,    0,    4,    0        },
  2204. X#endif
  2205. X    {"date-received",    0,    0,    13,    0        },
  2206. X    {"expires",        0,    0,    7,    HT_HIDE|HT_MAGIC},
  2207. X    {"followup-to",    0,    0,    11,    0        },
  2208. X    {"from",        0,    0,    4,    HT_MAGIC    },
  2209. X    {"keywords",    0,    0,    8,    0        },
  2210. X    {"lines",        0,    0,    5,    0        },
  2211. X    {"message-id",    0,    0,    10,    HT_HIDE        },
  2212. X    {"nf-from",        0,    0,    7,    HT_HIDE        },
  2213. X    {"nf-id",        0,    0,    5,    HT_HIDE        },
  2214. X    {"newsgroups",    0,    0,    10,    HT_MAGIC|HT_HIDE},
  2215. X    {"organization",    0,    0,    12,    0        },
  2216. X    {"path",        0,    0,    4,    HT_HIDE        },
  2217. X    {"posted",        0,    0,    6,    HT_HIDE        },
  2218. X    {"posting-version",    0,    0,    15,    HT_HIDE        },
  2219. X    {"reply-to",    0,    0,    8,    HT_HIDE        },
  2220. X    {"references",    0,    0,    10,    HT_HIDE        },
  2221. X    {"relay-version",    0,    0,    13,    HT_HIDE        },
  2222. X    {"sender",        0,    0,    6,    HT_HIDE        },
  2223. X    {"summary",        0,    0,    7,    0        },
  2224. X    {"subject",        0,    0,    7,    HT_MAGIC    },
  2225. X    {"xref",        0,    0,    4,    HT_HIDE        }
  2226. X};
  2227. X#endif
  2228. X
  2229. X#ifdef ASYNC_PARSE
  2230. XEXT ART_NUM parsed_art INIT(0);
  2231. X#endif
  2232. X
  2233. XEXT char in_header INIT(0);        /* are we decoding the header? */
  2234. X
  2235. X#ifdef CACHESUBJ
  2236. X    EXT char **subj_list INIT(Null(char **));
  2237. X#endif
  2238. X
  2239. Xvoid    head_init ANSI((void));
  2240. Xint    set_line_type ANSI((char *,char *));
  2241. Xvoid    start_header ANSI((ART_NUM));
  2242. Xbool    parseline ANSI((char *,int,int));
  2243. X#ifdef ASYNC_PARSE
  2244. X    int        parse_maybe ANSI((ART_NUM));
  2245. X#endif
  2246. Xchar    *fetchsubj ANSI((ART_NUM,bool,bool));
  2247. Xchar    *fetchlines ANSI((ART_NUM,int));
  2248. X
  2249. X#ifdef DEBUGGING
  2250. Xint    dumpheader ANSI((char *));
  2251. X#endif
  2252. END_OF_FILE
  2253.   if test 3993 -ne `wc -c <'head.h'`; then
  2254.     echo shar: \"'head.h'\" unpacked with wrong size!
  2255.   fi
  2256.   # end of 'head.h'
  2257. fi
  2258. if test -f 'patchlevel' -a "${1}" != "-c" ; then 
  2259.   echo shar: Will not clobber existing file \"'patchlevel'\"
  2260. else
  2261.   echo shar: Extracting \"'patchlevel'\" \(11 characters\)
  2262.   sed "s/^X//" >'patchlevel' <<'END_OF_FILE'
  2263. XTrn v1.0.3
  2264. END_OF_FILE
  2265.   if test 11 -ne `wc -c <'patchlevel'`; then
  2266.     echo shar: \"'patchlevel'\" unpacked with wrong size!
  2267.   fi
  2268.   # end of 'patchlevel'
  2269. fi
  2270. if test -f 'zab' -a "${1}" != "-c" ; then 
  2271.   echo shar: Will not clobber existing file \"'zab'\"
  2272. else
  2273.   echo shar: Extracting \"'zab'\" \(3293 characters\)
  2274.   sed "s/^X//" >'zab' <<'END_OF_FILE'
  2275. X   File Name        Archive #    Description
  2276. X----------------------------------------------------------
  2277. XREADME                     1    
  2278. XMANIFEST                  12    
  2279. XConfigure.1                3    
  2280. XConfigure.2                1    
  2281. XEXTERN.h                  14    
  2282. XHACKERSGUIDE              12    
  2283. XINIT                       6    
  2284. XINTERN.h                  14    
  2285. XMakefile.SH               12    
  2286. XNEW                       13    
  2287. XPnews.1                   13    
  2288. XPnews.SH                   9    
  2289. XRnmail.1                  13    
  2290. XRnmail.SH                 12    
  2291. XWishlist                  14    
  2292. Xaddng.c                   13    
  2293. Xaddng.h                   14    
  2294. Xart.c                      4    
  2295. Xart.h                     14    
  2296. Xartio.c                   13    
  2297. Xartio.h                    2    
  2298. Xartsrch.c                 12    
  2299. Xartsrch.h                 14    
  2300. Xartstate.h                14    
  2301. Xbackpage.c                13    
  2302. Xbackpage.h                14    
  2303. Xbits.c                     2    
  2304. Xbits.h                    11    
  2305. Xcheat.c                    6    
  2306. Xcheat.h                   14    
  2307. Xcommon.h                   6    
  2308. Xfinal.c                   12    
  2309. Xfinal.h                   14    
  2310. Xgetactive.c               13    
  2311. Xgetdate.y                  9    
  2312. Xhead.c                    10    
  2313. Xhead.h                     1    
  2314. Xhelp.c                     9    
  2315. Xhelp.h                    14    
  2316. Xinit.c                    11    
  2317. Xinit.h                    14    
  2318. Xintrp.c                    5    
  2319. Xintrp.h                   14    
  2320. Xkfile.c                   12    
  2321. Xkfile.h                   14    
  2322. Xlast.c                    14    
  2323. Xlast.h                    14    
  2324. Xmakedepend.SH             13    
  2325. Xmakedir.SH                14    
  2326. Xmakekit                   14    
  2327. Xmbox.saver.SH             13    
  2328. Xmt-lint.h                 14    
  2329. Xmt-process.c               5    
  2330. Xmt-read.c                 10    
  2331. Xmt-write.c                 7    
  2332. Xmt.check.SH                3    
  2333. Xmthreads.1                11    
  2334. Xmthreads.c                 6    
  2335. Xmthreads.h                13    
  2336. Xndir.c                    13    
  2337. Xndir.h                    13    
  2338. Xnewsetup.1                13    
  2339. Xnewsetup.SH               13    
  2340. Xnewsgroups.1              13    
  2341. Xnewsgroups.SH             13    
  2342. Xnewsnews.SH               14    
  2343. Xng.c                       4    
  2344. Xng.h                      14    
  2345. Xngdata.c                  11    
  2346. Xngdata.h                  14    
  2347. Xngsrch.c                  13    
  2348. Xngsrch.h                  14    
  2349. Xngstuff.c                 11    
  2350. Xngstuff.h                 14    
  2351. Xnorm.saver.SH             14    
  2352. Xonly.c                    13    
  2353. Xonly.h                    14    
  2354. Xpatchlevel                 1    
  2355. Xrcln.c                    10    
  2356. Xrcln.h                    14    
  2357. Xrcstuff.c                  7    
  2358. Xrcstuff.h                 14    
  2359. Xrespond.c                  8    
  2360. Xrespond.h                 14    
  2361. Xrn.c                       9    
  2362. Xrn.h                      14    
  2363. Xrt-rn.c                    8    
  2364. Xrt-select.c                8    
  2365. Xrthreads.c                12    
  2366. Xrthreads.h                13    
  2367. Xsearch.c                  10    
  2368. Xsearch.h                  14    
  2369. Xsw.c                      10    
  2370. Xsw.h                      14    
  2371. Xterm.c                     7    
  2372. Xterm.h                    11    
  2373. Xthreads.c                 13    
  2374. Xthreads.h                 13    
  2375. Xtrn.1.1                    3    
  2376. Xtrn.1.2                    2    
  2377. Xunipatch.c                14    
  2378. Xutil.c                    11    
  2379. Xutil.h                    14    
  2380. Xuudecode.c                12    
  2381. Xuudecode.h                 8    
  2382. Xzab                        1    This shipping list
  2383. END_OF_FILE
  2384.   if test 3293 -ne `wc -c <'zab'`; then
  2385.     echo shar: \"'zab'\" unpacked with wrong size!
  2386.   fi
  2387.   # end of 'zab'
  2388. fi
  2389. echo shar: End of archive 1 \(of 14\).
  2390. cp /dev/null ark1isdone
  2391. MISSING=""
  2392. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ; do
  2393.     if test ! -f ark${I}isdone ; then
  2394.     MISSING="${MISSING} ${I}"
  2395.     fi
  2396. done
  2397. if test "${MISSING}" = "" ; then
  2398.     echo You have unpacked all 14 archives.
  2399.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2400. else
  2401.     echo You still must unpack the following archives:
  2402.     echo "        " ${MISSING}
  2403. fi
  2404. exit 0
  2405.